<%--
  Created by IntelliJ IDEA.
  User: Potato
  Date: 2025/10/20
  Time: 16:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>图书管理系统 - 登录</title>
    <!-- Bootstrap5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 图标库 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
    <style>
        body { background-color: #f8f9fa; }
        .login-card { margin-top: 8rem; box-shadow: 0 0 20px rgba(0,0,0,0.05); }
    </style>
</head>
<body>
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-6 col-lg-4">
            <div class="card login-card p-4">
                <div class="text-center mb-4">
                    <i class="bi bi-book-half text-primary" style="font-size: 3rem;"></i>
                    <h2 class="mt-2">图书管理系统</h2>
                    <p class="text-muted">请登录您的账号</p>
                </div>

                <form action="login" method="post">
                    <!-- 用户名输入框 -->
                    <div class="input-group mb-3">
                        <span class="input-group-text"><i class="bi bi-person"></i></span>
                        <input type="text" name="username" class="form-control" placeholder="用户名" required>
                    </div>

                    <!-- 密码输入框 -->
                    <div class="input-group mb-3">
                        <span class="input-group-text"><i class="bi bi-lock"></i></span>
                        <input type="password" name="password" class="form-control" placeholder="密码" required>
                    </div>

                    <!-- 记住我选项 -->
                    <div class="form-check mb-3">
                        <input type="checkbox" name="rememberMe" class="form-check-input" id="rememberMe">
                        <label class="form-check-label" for="rememberMe">记住我</label>
                    </div>

                    <!-- 登录按钮 -->
                    <button type="submit" class="btn btn-primary w-100 mb-3">登录</button>

                    <!-- 注册跳转链接 -->
                    <div class="text-center">
                        <span class="text-muted">还没有账号？</span>
                        <a href="${pageContext.request.contextPath}/register.jsp" class="text-primary">立即注册</a>
                    </div>
                </form>

                <!-- 错误提示 -->
                <% if (request.getAttribute("errorMsg") != null) { %>
                <div class="alert alert-danger mt-3 text-center" role="alert">
                    ${errorMsg}
                </div>
                <% } %>
            </div>
        </div>
    </div>
</div>

<!-- Bootstrap5 JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
